package com.ruoyi.spot.realtime.kline.service.impl;

import java.util.List;

import com.ruoyi.spot.openapi.currencyPair.domain.SpotCurrencyPair;
import com.ruoyi.spot.realtime.kline.domain.VO.SpotKlineRealtimeDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.spot.realtime.kline.mapper.SpotKlineRealtimeDataMapper;
import com.ruoyi.spot.realtime.kline.domain.SpotKlineRealtimeData;
import com.ruoyi.spot.realtime.kline.service.ISpotKlineRealtimeDataService;

/**
 * 实时K线监控Service业务层处理
 *
 * @author saumell
 * @date 2024-07-31
 */
@Service
public class SpotKlineRealtimeDataServiceImpl implements ISpotKlineRealtimeDataService {
    @Autowired
    private SpotKlineRealtimeDataMapper spotKlineRealtimeDataMapper;

    /**
     * 查询实时K线监控
     *
     * @param id 实时K线监控主键
     * @return 实时K线监控
     */
    @Override
    public SpotKlineRealtimeDataVO selectSpotKlineRealtimeDataById(Long id) {
        return spotKlineRealtimeDataMapper.selectSpotKlineRealtimeDataById(id);
    }

    /**
     * 查询实时K线监控列表
     *
     * @param spotKlineRealtimeData 实时K线监控
     * @return 实时K线监控
     */
    @Override
    public List<SpotKlineRealtimeDataVO> selectSpotKlineRealtimeDataList(SpotKlineRealtimeDataVO spotKlineRealtimeData) {
        return spotKlineRealtimeDataMapper.selectSpotKlineRealtimeDataList(spotKlineRealtimeData);
    }

    /**
     * 新增实时K线监控
     *
     * @param spotKlineRealtimeData 实时K线监控
     * @return 结果
     */
    @Override
    public int insertSpotKlineRealtimeData(SpotKlineRealtimeData spotKlineRealtimeData) {
        return spotKlineRealtimeDataMapper.insertSpotKlineRealtimeData(spotKlineRealtimeData);
    }

    /**
     * 修改实时K线监控
     *
     * @param spotKlineRealtimeData 实时K线监控
     * @return 结果
     */
    @Override
    public int updateSpotKlineRealtimeData(SpotKlineRealtimeData spotKlineRealtimeData) {
        return spotKlineRealtimeDataMapper.updateSpotKlineRealtimeData(spotKlineRealtimeData);
    }

    /**
     * 批量删除实时K线监控
     *
     * @param ids 需要删除的实时K线监控主键
     * @return 结果
     */
    @Override
    public int deleteSpotKlineRealtimeDataByIds(Long[] ids) {
        return spotKlineRealtimeDataMapper.deleteSpotKlineRealtimeDataByIds(ids);
    }

    /**
     * 删除实时K线监控信息
     *
     * @param id 实时K线监控主键
     * @return 结果
     */
    @Override
    public int deleteSpotKlineRealtimeDataById(Long id) {
        return spotKlineRealtimeDataMapper.deleteSpotKlineRealtimeDataById(id);
    }

    @Override
    public List<SpotCurrencyPair> queryDatabasedata() {
        return spotKlineRealtimeDataMapper.queryDatabasedata();
    }

    @Override
    public void addnewcurrency_pair(String currencyPair) {
        spotKlineRealtimeDataMapper.addnewcurrency_pair(currencyPair);
    }

    @Override
    public void deletenewcurrency_pair(String currencyPair) {
        spotKlineRealtimeDataMapper.deletenewcurrency_pair(currencyPair);
    }

    @Override
    public List<SpotKlineRealtimeDataVO> selectSpotAllData() {
        return spotKlineRealtimeDataMapper.selectSpotAllData();
    }

    @Override
    public Integer queryCurryNumber(String currencyPair) {
        return spotKlineRealtimeDataMapper.queryCurryNumber(currencyPair);
    }

    @Override
    public int queryabiosisbycurrency(String name) {
        return spotKlineRealtimeDataMapper.queryabiosisbycurrency(name);
    }

    // ==================== 请将以下代码块添加到类中 ====================
    @Override
    public List<SpotCurrencyPair> queryAllDatabasedata() {
        return spotKlineRealtimeDataMapper.queryAllDatabasedata();
    }

    @Override
    public void reactivateCurrencyPair(String currencyPair) {
        spotKlineRealtimeDataMapper.reactivateCurrencyPair(currencyPair);
    }

}
